package com.mijie.fentsi;
import java.io.IOException;  
import java.io.StringReader;  
  
import org.wltea.analyzer.core.IKSegmenter;  
import org.wltea.analyzer.core.Lexeme;  

public class luceneImp {
	
	

//	   StringReader input = new StringReader(query.trim());
//
//       IKSegmenter ikSeg = new IKSegmenter(input, true);// true　用智能分词　，false细粒度
//       for (Lexeme lexeme = ikSeg.next(); lexeme != null; lexeme = ikSeg.next()) {
//           list.add(lexeme.getLexemeText());
//       }

 
	      
	    public static void main(String[] args) throws IOException {  
	        String text="信件 函件 整机 零件";  
	        text=	"他说他还爱我，的确，他对我很好。可是他又总喜欢和别的女生聊天。我该不该和他提出分手  欢和好像";
	    	
	        StringReader sr=new StringReader(text);  
	        IKSegmenter ik=new IKSegmenter(sr, true);  
	        
	        Lexeme lex=null;  
	        while((lex=ik.next())!=null){  
	            System.out.print(lex.getLexemeText()+"|");  
	        }  
  
	  
	}  

}
